class Solution(object):
    def getMaximumConsecutive(self, coins):
        coins.sort()
        max_val = 0
        for c in coins:
            if c <= max_val + 1:
                max_val = max_val + c
            else:
                return max_val + 1
        return max_val + 1